Added documentation and bindings for host_cpu.features.
authorEwan Mellor <ewan@xensource.com>
Wed, 11 Apr 2007 20:55:05 +0000 (21:55 +0100)
committerEwan Mellor <ewan@xensource.com>
Wed, 11 Apr 2007 20:55:05 +0000 (21:55 +0100)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
docs/xen-api/xenapi-datamodel.tex
tools/libxen/include/xen_host_cpu.h
tools/libxen/src/xen_host_cpu.c

index a631be8a354752d09f621ca330f0fcdb2e396681..353fb1cc1231f6a73fa9bd487bc207d86396f182 100644 (file)
@@ -6634,7 +6634,8 @@ $\mathit{RO}_\mathit{run}$ &  {\tt vendor} & string & the vendor of the physical
 $\mathit{RO}_\mathit{run}$ &  {\tt speed} & int & the speed of the physical CPU \\
 $\mathit{RO}_\mathit{run}$ &  {\tt modelname} & string & the model name of the physical CPU \\
 $\mathit{RO}_\mathit{run}$ &  {\tt stepping} & string & the stepping of the physical CPU \\
-$\mathit{RO}_\mathit{run}$ &  {\tt flags} & string & the flags of the physical CPU \\
+$\mathit{RO}_\mathit{run}$ &  {\tt flags} & string & the flags of the physical CPU (a decoded version of the features field) \\
+$\mathit{RO}_\mathit{run}$ &  {\tt features} & string & the physical CPU feature bitmap \\
 $\mathit{RO}_\mathit{run}$ &  {\tt utilisation} & float & the current CPU utilisation \\
 \hline
 \end{longtable}
@@ -6912,6 +6913,38 @@ string
 }
 
 
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_features}
+
+{\bf Overview:} 
+Get the features field of the given host\_cpu.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} string get_features (session_id s, host_cpu ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host\_cpu ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string
+}
+
+
 value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
index 8b6d37f5e39f7b2ce6a713583047bc2ac4a8f5c2..b484793782797e26779e44e09f55413b1a754d99 100644 (file)
@@ -70,6 +70,7 @@ typedef struct xen_host_cpu_record
     char *modelname;
     char *stepping;
     char *flags;
+    char *features;
     double utilisation;
 } xen_host_cpu_record;
 
@@ -222,6 +223,13 @@ extern bool
 xen_host_cpu_get_flags(xen_session *session, char **result, xen_host_cpu host_cpu);
 
 
+/**
+ * Get the features field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu);
+
+
 /**
  * Get the utilisation field of the given host_cpu.
  */
index c03241dc84ddeccbc2642a17a877ab8c8863e6a2..9509c570e428805f0d82753b2203907a41bc5f8d 100644 (file)
@@ -61,6 +61,9 @@ static const struct_member xen_host_cpu_record_struct_members[] =
         { .key = "flags",
           .type = &abstract_type_string,
           .offset = offsetof(xen_host_cpu_record, flags) },
+        { .key = "features",
+          .type = &abstract_type_string,
+          .offset = offsetof(xen_host_cpu_record, features) },
         { .key = "utilisation",
           .type = &abstract_type_float,
           .offset = offsetof(xen_host_cpu_record, utilisation) }
@@ -90,6 +93,7 @@ xen_host_cpu_record_free(xen_host_cpu_record *record)
     free(record->modelname);
     free(record->stepping);
     free(record->flags);
+    free(record->features);
     free(record);
 }
 
@@ -251,6 +255,23 @@ xen_host_cpu_get_flags(xen_session *session, char **result, xen_host_cpu host_cp
 }
 
 
+bool
+xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host_cpu }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("host_cpu.get_features");
+    return session->ok;
+}
+
+
 bool
 xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu)
 {